Repository navigation
Standardize application job definitions - #1289
Conversation
f67a007 to
025181a
Compare
|
Oh this is marvelous refactoring, thank you Ollie! One thing I'm not sure about is how the Job Classes that now would extend the base Job class behave with regards to how the queue workers are started (60s vs 90s timeout, also not quite sure with the retries): https://github.com/wbstack/api/blob/main/start.sh#L24 |
Yes, that's a great thing to point out! While working on this I also noticed that the Also, the jobs need to be dispatched onto an asynchronous queue for any of the
I think we have quite a few uses of the |
|
Your comment prompted me look at this some more. The tl;dr is that I think it's all okay for these jobs to now extend the Job abstract base class with a timeout of 60s. I think that the timeout you linked to only applies to the artisan queue worker that is run when When Laravel Horizon is enabled, the configured timeout is 3600s (1h) - our api chart doesn't currently allow us to override the timeout with the So, going from the Horizon timeout of 3600s to 60s in quite the change. There are three application jobs in this PR that now extend this Job base class where they didn't previously:
While I think we need to rework these job and queue worker timeouts (and the queue connection |
Remove the no-longer-used `DispatchesJobs` trait from `QueueSearchIndexBatches`. The `$this->dispatch()` statement that was making use of this trait was removed in 00c5872 as part of the Laravel 10 upgrade. Bug: T440286
* Use `Illuminate\Foundation\Queue\Queueable` in `App\Jobs\Job` so every application job receives the same dispatching, queue interaction, queue configuration, and model serialization behavior from a single source. * Convert relevant Jobs to inherit from this shared base. * Add an architecture test to check that all queueable jobs extend `App\Jobs\Job`. Bug: T440286
025181a to
4cac2be
Compare
Illuminate\Foundation\Queue\QueueableinApp\Jobs\Jobso every application job receives the same dispatching, queue interaction, queue configuration, and model serialization behavior from a single source.App\Jobs\Job.Having consistent job behaviour will make it easier to reason about the codebase and ensure shared configuration is applied centrally.
Bug: T440286